#include "threadshell.h"
#include "QProcess"
#include "QMessageBox"
ThreadShell::ThreadShell()
{

}

void ThreadShell::run()
{
    QProcess *process =new QProcess;
    if(flag==1)
    {
        process->execute(shellcmd);
    }
    else if(flag==2)
    {
        while(1)
        {
            process->execute(shellcmd);
            msleep(20000);
        }
    }

}

void ThreadShell::rec_shell(QString sh)
{
    shellcmd=sh;
}

void ThreadShell::setflg(int f)
{
    flag=f;
}
